home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume8 / gnuplot1.10A / part02 < prev    next >
Encoding:
Text File  |  1989-09-09  |  54.9 KB  |  2,485 lines

  1. Newsgroups: comp.sources.misc
  2. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  3. Subject: v08i036: GnuPlot v1.10A (part 2 of 7)
  4. Reply-To: canoaf@ntvax.UUCP (Augustine Cano)
  5.  
  6. Posting-number: Volume 8, Issue 36
  7. Submitted-by: canoaf@ntvax.UUCP (Augustine Cano)
  8. Archive-name: gnuplot1.10A/part02
  9.  
  10. [OOPS!!!  I had to patch these after receiving them -- and managed to lose the
  11. name of the person who submitted them in the process.  Duh.  The name shown
  12. is a "best guess".  Submitter, please correct me.  ++bsa]
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 2 (of 7)."
  21. # Contents:  gnuplot.1 graphics.c header.mac help hp26.trm hp75.trm
  22. #   hpljet.trm hrcgraph.asm internal.c iris4d.trm lineproc.mac
  23. #   link.com link.opt link.otc
  24. # Wrapped by allbery@uunet on Sat Sep  9 13:47:19 1989
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'gnuplot.1' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'gnuplot.1'\"
  28. else
  29. echo shar: Extracting \"'gnuplot.1'\" \(1896 characters\)
  30. sed "s/^X//" >'gnuplot.1' <<'END_OF_FILE'
  31. X.\" dummy line
  32. X.TH GNUPLOT 1 "28 January 1987"
  33. X.UC 4
  34. X.SH NAME
  35. Xgnuplot \- an interactive plotting program
  36. X.SH SYNOPSIS
  37. X.B gnuplot
  38. X.br
  39. X.SH DESCRIPTION
  40. X.I Gnuplot 
  41. Xis a command-driven interactive function plotting program.
  42. XHere are some of its features:
  43. X.PP
  44. XPlots any number of functions, built up of C operators, C library
  45. Xfunctions, and some things C doesn't have like **, sgn(), etc.  Also
  46. Xsupport for plotting data files, to compare actual
  47. Xdata to theoretical curves.
  48. X.PP
  49. XUser-defined X and Y ranges (optional Y auto-ranging), smart Y scaling,
  50. Xsmart tic marks.
  51. X.PP
  52. XUser-defined constants and functions.
  53. X.PP
  54. XSupport through a generalized graphics driver for
  55. XAED 767,
  56. XBBN BitGraph,
  57. XHP2623,
  58. XHP75xx,
  59. XPOSTSCRIPT,
  60. XQMS QUIC
  61. XReGis (VT125 and VT2xx),
  62. XSelanar,
  63. XTek 401x,
  64. XVectrix 384,
  65. Xand unixplot.  The PC version
  66. Xsupports IBM CGA & EGA, Hercules, ATT 6300,
  67. Xand Corona 325 graphics.  Other devices can be added
  68. Xsimply, but will require recompiling.
  69. X.PP
  70. XShell escapes and command line substitution.
  71. X.PP
  72. XLoad and save capability.
  73. X.PP
  74. XOutput redirection.
  75. X.PP
  76. XAll computations performed in the complex domain.  Just the real part is
  77. Xplotted by default, but functions like imag() and abs() and arg() are
  78. Xavailable to override this.
  79. X.SH AUTHORS
  80. XThomas Williams and Colin Kelley, Villanova University.
  81. X.br
  82. X(vu-vlsi!plot.UUCP)
  83. X.SH BUGS
  84. XThe unixplot library does not provide for sending unixplot output to
  85. Xa file.  As a result, unixplot output cannot be sent to a file with the
  86. X.I Gnuplot
  87. X\&'set output' command; instead, standard output must be redirected
  88. Xto this file from the Unix command line.  For example:
  89. X.IP
  90. X\ \ \ \ \ \ \ 
  91. X.I % gnuplot > unixplot.out
  92. X.br
  93. X\ \ \ \ \ \ \ \ gnuplot>
  94. X.I set term unxiplot
  95. X.br
  96. X\ \ \ \ \ \ \ \ gnuplot>
  97. X.I plot sin(x)
  98. X.PP
  99. XThe atan() function does not work correctly for complex arguments.
  100. X.SH SEE ALSO
  101. XSee the printed manual or the on-line help for details on specific commands.
  102. END_OF_FILE
  103. if test 1896 -ne `wc -c <'gnuplot.1'`; then
  104.     echo shar: \"'gnuplot.1'\" unpacked with wrong size!
  105. fi
  106. # end of 'gnuplot.1'
  107. fi
  108. if test -f 'graphics.c' -a "${1}" != "-c" ; then 
  109.   echo shar: Will not clobber existing file \"'graphics.c'\"
  110. else
  111. echo shar: Extracting \"'graphics.c'\" \(9002 characters\)
  112. sed "s/^X//" >'graphics.c' <<'END_OF_FILE'
  113. X/*
  114. X *
  115. X *    G N U P L O T  --  graphics.c
  116. X *
  117. X *  Copyright (C) 1986, 1987  Thomas Williams, Colin Kelley
  118. X *
  119. X *  You may use this code as you wish if credit is given and this message
  120. X *  is retained.
  121. X *
  122. X *  Please e-mail any useful additions to vu-vlsi!plot so they may be
  123. X *  included in later releases.
  124. X *
  125. X *  This file should be edited with 4-column tabs!  (:set ts=4 sw=4 in vi)
  126. X */
  127. X
  128. X#include <stdio.h>
  129. X#include <math.h>
  130. X#include "plot.h"
  131. X
  132. Xchar *strcpy(),*strncpy(),*strcat();
  133. X
  134. Xextern BOOLEAN polar;
  135. Xextern BOOLEAN autoscale;
  136. Xextern FILE *outfile;
  137. Xextern BOOLEAN log_x, log_y;
  138. Xextern int term;
  139. X
  140. Xextern BOOLEAN screen_ok;
  141. Xextern BOOLEAN term_init;
  142. X
  143. Xextern double loff,roff,toff,boff;
  144. Xextern double zero;
  145. X
  146. Xextern struct termentry term_tbl[];
  147. X
  148. X
  149. X#ifndef max        /* Lattice C has max() in math.h, but shouldn't! */
  150. X#define max(a,b) ((a > b) ? a : b)
  151. X#endif
  152. X
  153. X/* maps floating point x (and y) to screen */ 
  154. X#define map_x(x) (int)((x-xmin)*xscale) 
  155. X#define map_y(y) (int)((y-ymin)*yscale)
  156. X
  157. X
  158. Xdouble raise(x,y)
  159. Xdouble x;
  160. Xint y;
  161. X{
  162. Xregister int i;
  163. Xdouble val;
  164. X
  165. X    val = 1.0;
  166. X    for (i=0; i < abs(y); i++)
  167. X        val *= x;
  168. X    if (y < 0 ) return (1.0/val);
  169. X    return(val);
  170. X}
  171. X
  172. X
  173. Xdouble make_tics(tmin,tmax,logscale)
  174. Xdouble tmin,tmax;
  175. XBOOLEAN logscale;
  176. X{
  177. Xregister double xr,xnorm,tics,tic,l10;
  178. X
  179. X    xr = fabs(tmin-tmax);
  180. X    
  181. X    l10 = log10(xr);
  182. X    if (logscale) {
  183. X        tic = raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
  184. X        if (tic < 1.0)
  185. X            tic = 1.0;
  186. X    } else {
  187. X        xnorm = pow(10.0,l10-(double)((l10 >= 0.0 ) ? (int)l10 : ((int)l10-1)));
  188. X        if (xnorm <= 2)
  189. X            tics = 0.2;
  190. X        else if (xnorm <= 5)
  191. X            tics = 0.5;
  192. X        else tics = 1.0;    
  193. X        tic = tics * raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
  194. X    }
  195. X    return(tic);
  196. X}
  197. X
  198. Xchar *idx(a,b)
  199. Xchar *a,b;
  200. X{
  201. X    do {
  202. X        if (*a == b)
  203. X            return(a);
  204. X    } while (*a++);
  205. X    return(0);
  206. X}
  207. X
  208. Xnum2str(num,str)
  209. Xdouble num;
  210. Xchar str[];
  211. X{
  212. Xstatic char temp[80];
  213. Xregister double d;
  214. Xregister char *a,*b;
  215. X
  216. X     if ((d = fabs(num)) > 9999.0 || d < 0.001 && d != 0.0) 
  217. X        (void) sprintf(temp,"%-.3e",num);    
  218. X    else
  219. X        (void) sprintf(temp,"%-.3g",num);
  220. X    if (b = idx(temp,'e')) {
  221. X        a = b;
  222. X        while ( *(--a) == '0') /* trailing zeros */
  223. X            ;    
  224. X        if ( *a == '.') 
  225. X            a--;
  226. X        (void) strncpy(str,temp,(int)(a-temp)+1);
  227. X        str[(int)(a-temp)+1] = '\0';
  228. X        a = b+1;    /* point to 1 after 'e' */
  229. X        (void) strcat(str,"e");
  230. X        if ( *a == '-') 
  231. X            (void) strcat(str,"-");
  232. X        a++;                         /* advance a past '+' or '-' */
  233. X        while ( *a == '0' && *(a+1) != '\0') /* leading zeroes */
  234. X            a++;
  235. X        (void) strcat(str,a); /* copy rest of string */
  236. X    }
  237. X    else
  238. X        (void) strcpy(str,temp);    
  239. X}
  240. X
  241. X
  242. Xdo_plot(plots, pcount, xmin, xmax, ymin, ymax)
  243. Xstruct curve_points *plots;
  244. Xint pcount;            /* count of plots in linked list */
  245. Xdouble xmin, xmax;
  246. Xdouble ymin, ymax;
  247. X{
  248. Xregister int i, x;
  249. Xregister struct termentry *t = &term_tbl[term];
  250. Xregister BOOLEAN prev_undef;
  251. Xregister int curve, xaxis_y, yaxis_x, dpcount;
  252. Xregister struct curve_points *this_plot;
  253. Xregister enum PLOT_TYPE p_type;
  254. Xregister double xscale, yscale;
  255. Xregister double ytic, xtic, least, most, ticplace;
  256. Xregister int mms,mts;
  257. X            /* only a Pyramid would have this many registers! */
  258. Xstatic char xns[20],xms[20],yns[20],yms[20],xts[20],yts[20];
  259. Xstatic char label[80];
  260. X
  261. X    if (polar)
  262. X        polar_xform (plots, pcount, &xmin, &xmax, &ymin, &ymax);
  263. X
  264. X    if (ymin == HUGE || ymax == -HUGE)
  265. X        int_error("all points undefined!", NO_CARET);
  266. X
  267. X/*    This used be xmax == xmin, but that caused an infinite loop once. */
  268. X    if (fabs(xmax - xmin) < zero)
  269. X        int_error("xmin should not equal xmax!",NO_CARET);
  270. X    if (fabs(ymax - ymin) < zero)
  271. X        int_error("ymin should not equal ymax!",NO_CARET);
  272. X
  273. X/*    Apply the desired viewport offsets. */
  274. X    xmin -= loff;
  275. X    xmax += roff;
  276. X    ymin -= boff;
  277. X    ymax += toff;
  278. X    
  279. X    ytic = make_tics(ymin,ymax,log_y);
  280. X    xtic = make_tics(xmin,xmax,log_x);
  281. X    dpcount = 0;
  282. X    
  283. X    if (ymin < ymax ) {
  284. X        ymin = ytic * floor(ymin/ytic);    
  285. X        ymax = ytic * ceil(ymax/ytic);
  286. X    }
  287. X    else {
  288. X        ymin = ytic * ceil(ymin/ytic);
  289. X        ymax = ytic * floor(ymax/ytic);
  290. X    }
  291. X
  292. X    yscale = (t->ymax - 2)/(ymax - ymin);
  293. X    xscale = (t->xmax - 2)/(xmax - xmin);
  294. X    
  295. X    if (!term_init) {
  296. X        (*t->init)();
  297. X        term_init = TRUE;
  298. X    }
  299. X    screen_ok = FALSE;
  300. X    (*t->graphics)();
  301. X    (*t->linetype)(-2); /* border linetype */
  302. X
  303. X    /* draw plot border */
  304. X    (*t->move)(0,0);    
  305. X    (*t->vector)(t->xmax-1,0);    
  306. X    (*t->vector)(t->xmax-1,t->ymax-1);    
  307. X    (*t->vector)(0,t->ymax-1);    
  308. X    (*t->vector)(0,0);
  309. X
  310. X    least = (ymin < ymax) ? ymin : ymax;
  311. X    most = (ymin < ymax) ? ymax : ymin;
  312. X
  313. X    for (ticplace = ytic + least; ticplace < most ; ticplace += ytic) { 
  314. X        (*t->move)(0,map_y(ticplace));
  315. X        (*t->vector)(t->h_tic,map_y(ticplace));
  316. X        (*t->move)(t->xmax-1,map_y(ticplace));
  317. X                   (*t->vector)(t->xmax-1-t->h_tic,map_y(ticplace));
  318. X    }
  319. X
  320. X    if (xmin < xmax ) {
  321. X        least = xtic * floor(xmin/xtic);    
  322. X        most = xtic * ceil(xmax/xtic);
  323. X    }
  324. X    else {
  325. X        least = xtic * ceil(xmin/xtic);
  326. X        most = xtic * floor(xmax/xtic);
  327. X    }
  328. X
  329. X    for (ticplace = xtic + least; ticplace < most ; ticplace += xtic) { 
  330. X        (*t->move)(map_x(ticplace),0);
  331. X        (*t->vector)(map_x(ticplace),t->v_tic);
  332. X        (*t->move)(map_x(ticplace),t->ymax-1);
  333. X                   (*t->vector)(map_x(ticplace),t->ymax-1-t->v_tic);
  334. X    }
  335. X
  336. X    if (log_x) {
  337. X        num2str(pow(10.0,xmin),xns);
  338. X        num2str(pow(10.0,xmax),xms);
  339. X        num2str(pow(10.0,xtic),xts);
  340. X    }
  341. X    else {
  342. X        num2str(xmin,xns);
  343. X        num2str(xmax,xms);
  344. X        num2str(xtic,xts);
  345. X    }
  346. X    if (log_y) {
  347. X        num2str(pow(10.0,ymin),yns);
  348. X        num2str(pow(10.0,ymax),yms);
  349. X        num2str(pow(10.0,ytic),yts);
  350. X    } else {
  351. X        num2str(ymin,yns);
  352. X        num2str(ymax,yms);
  353. X        num2str(ytic,yts);
  354. X    }
  355. X    mms = max(strlen(xms),strlen(yms));
  356. X    mts = max(strlen(xts),strlen(yts));
  357. X
  358. X    (void) sprintf(label,"%s < y < %-*s  inc = %-*s",yns,mms,yms,mts,yts);
  359. X    (*t->lrput_text)(0, label);
  360. X    (void) sprintf(label,"%s < x < %-*s  inc = %-*s",xns,mms,xms,mts,xts);
  361. X    (*t->lrput_text)(1, label);
  362. X
  363. X
  364. X/* DRAW AXES */
  365. X    (*t->linetype)(-1);    /* axis line type */
  366. X    xaxis_y = map_y(0.0);
  367. X    yaxis_x = map_x(0.0); 
  368. X
  369. X    if (xaxis_y < 0)
  370. X        xaxis_y = 0;                /* save for impulse plotting */
  371. X    else if (xaxis_y >= t->ymax)
  372. X        xaxis_y = t->ymax - 1;
  373. X    else if (!log_y) {
  374. X        (*t->move)(0,xaxis_y);
  375. X        (*t->vector)((t->xmax-1),xaxis_y);
  376. X    }
  377. X
  378. X    if (!log_x && yaxis_x >= 0 && yaxis_x < t->xmax) {
  379. X        (*t->move)(yaxis_x,0);
  380. X        (*t->vector)(yaxis_x,(t->ymax-1));
  381. X    }
  382. X
  383. X/* DRAW CURVES */
  384. X    this_plot = plots;
  385. X    for (curve = 0; curve < pcount; this_plot = this_plot->next_cp, curve++) {
  386. X        (*t->linetype)(curve);
  387. X        (*t->ulput_text)(curve, this_plot->title);
  388. X        (*t->linetype)(curve);
  389. X
  390. X        p_type = this_plot->plot_type;
  391. X        switch(this_plot->plot_style) {
  392. X            case IMPULSES:
  393. X                for (i = 0; i < this_plot->p_count; i++) {
  394. X                    if (!this_plot->points[i].undefined) {
  395. X                        x = map_x(this_plot->points[i].x);
  396. X                        (*t->move)(x,xaxis_y);
  397. X                        (*t->vector)(x,map_y(this_plot->points[i].y));
  398. X                    }
  399. X                }
  400. X                break;
  401. X            case LINES:
  402. X                prev_undef = TRUE;
  403. X                for (i = 0; i < this_plot->p_count; i++) {
  404. X                    if (!this_plot->points[i].undefined) {
  405. X                        x = map_x(this_plot->points[i].x);
  406. X                        if (prev_undef)
  407. X                            (*t->move)(x,
  408. X                            map_y(this_plot->points[i].y));
  409. X                        (*t->vector)(x,
  410. X                            map_y(this_plot->points[i].y));
  411. X                    }
  412. X                    prev_undef = this_plot->points[i].undefined;
  413. X                }
  414. X                break;
  415. X            case POINTS:
  416. X                for (i = 0; i < this_plot->p_count; i++) {
  417. X                    if (!this_plot->points[i].undefined) {
  418. X                        x = map_x(this_plot->points[i].x);
  419. X                        (*t->point)(x,map_y(this_plot->points[i].y),dpcount);
  420. X                    }
  421. X                }
  422. X                dpcount++;
  423. X                break;
  424. X        }
  425. X    }
  426. X    (*t->text)();
  427. X    (void) fflush(outfile);
  428. X}
  429. X
  430. X
  431. Xpolar_xform (plots, pcount, xminp, xmaxp, yminp, ymaxp)
  432. Xstruct curve_points *plots;
  433. Xint pcount;            /* count of plots in linked list */
  434. Xdouble *xminp, *xmaxp;
  435. Xdouble *yminp, *ymaxp;
  436. X{
  437. Xregister int i, p_cnt;
  438. Xregister struct termentry *t = &term_tbl[term];
  439. Xregister struct curve_points *this_plot;
  440. Xenum PLOT_TYPE p_type;
  441. Xstruct coordinate *pnts;
  442. Xint curve, xaxis_y, yaxis_x, dpcount;
  443. Xdouble xmin, xmax, ymin, ymax, x, y;
  444. X
  445. X/*
  446. X    Cycle through all the plots converting polar to rectangular and adjust
  447. X    max and mins.
  448. X*/
  449. X    xmin = HUGE;
  450. X    ymin = HUGE;
  451. X    xmax = -HUGE;
  452. X    ymax = -HUGE;
  453. X    
  454. X    this_plot = plots;
  455. X    for (curve = 0; curve < pcount; this_plot = this_plot->next_cp, curve++) {
  456. X        p_cnt = this_plot->p_count;
  457. X        pnts = this_plot->points;
  458. X
  459. X    /*    Convert to cartesian all points in this curve. */
  460. X        for (i = 0; i < p_cnt; i++) {
  461. X            if (!pnts[i].undefined) {
  462. X                x = pnts[i].y*cos(pnts[i].x);
  463. X                y = pnts[i].y*sin(pnts[i].x);
  464. X                pnts[i].x = x;
  465. X                pnts[i].y = y;
  466. X                if (xmin > x) xmin = x;
  467. X                if (xmax < x) xmax = x;
  468. X            /*  Can't worry about autoscale (assume true). */
  469. X                if (ymin > y) ymin = y;
  470. X                if (ymax < y) ymax = y;
  471. X            }
  472. X        }    
  473. X    }
  474. X    if (xmin < xmax) {  /* All points might be undefined... */
  475. X        if (xmax - xmin < zero) {
  476. X        /* This happens at least for the plot of 1/cos(x) (verticle line). */
  477. X            xmin -= 3.14159;
  478. X            xmax += 3.14159;
  479. X        }
  480. X    }
  481. X    if (ymin < ymax) {  /* Only if there were defined points... */
  482. X        if (ymax - ymin < zero) {
  483. X        /* This happens at least for the plot of 1/sin(x) (horizontal line). */
  484. X            ymin -= 1;
  485. X            ymax += 1;
  486. X        }
  487. X    }
  488. X
  489. X/* Return the new maximums and minimums */
  490. X    *xminp = xmin;
  491. X    *xmaxp = xmax;
  492. X    *yminp = ymin;
  493. X    *ymaxp = ymax;
  494. X}
  495. END_OF_FILE
  496. if test 9002 -ne `wc -c <'graphics.c'`; then
  497.     echo shar: \"'graphics.c'\" unpacked with wrong size!
  498. fi
  499. # end of 'graphics.c'
  500. fi
  501. if test -f 'header.mac' -a "${1}" != "-c" ; then 
  502.   echo shar: Will not clobber existing file \"'header.mac'\"
  503. else
  504. echo shar: Extracting \"'header.mac'\" \(920 characters\)
  505. sed "s/^X//" >'header.mac' <<'END_OF_FILE'
  506. Xif1
  507. XCOMPACT    equ 1            ; define your memory model here
  508. X
  509. Xifdef    SMALL
  510. X    ; default, so do nothing
  511. X    else
  512. X
  513. Xifdef    MEDIUM
  514. X    LARGE_CODE equ 1
  515. X    else
  516. X
  517. Xifdef    COMPACT
  518. X    LARGE_DATA equ 1
  519. X    else
  520. X
  521. Xifdef    LARGE
  522. X    LARGE_DATA equ 1
  523. X    LARGE_CODE equ 1
  524. X
  525. Xelse
  526. X    %out No memory model defined--assuming SMALL
  527. X
  528. Xendif    ; LARGE
  529. Xendif    ; COMPACT
  530. Xendif    ; MEDIUM
  531. Xendif    ; SMALL
  532. X
  533. X
  534. Xbeginproc macro procname
  535. X
  536. Xifdef    LARGE_CODE
  537. X    procname proc far
  538. Xelse
  539. X    procname proc near
  540. Xendif    ; LARGE_CODE
  541. X
  542. X    endm    ; beginproc
  543. X
  544. X
  545. Xendif    ; if1
  546. X
  547. X
  548. X_TEXT    SEGMENT    BYTE PUBLIC 'CODE'
  549. X_TEXT    ENDS
  550. X_DATA    SEGMENT WORD PUBLIC 'DATA'
  551. X_DATA    ENDS
  552. XCONST    SEGMENT WORD PUBLIC 'CONST'
  553. XCONST    ENDS
  554. X_BSS    SEGMENT WORD PUBLIC 'BSS'
  555. X_BSS    ENDS
  556. X
  557. XDGROUP    GROUP    CONST, _BSS, _DATA
  558. X    assume cs:_text, ds:dgroup, ss:dgroup, es:dgroup
  559. X
  560. X; define X as the offset of first argument on stack frame
  561. X
  562. Xifdef LARGE_CODE
  563. X    X    equ 6            ; return offset and segment + old BP
  564. Xelse
  565. X    X    equ 4            ; return offset + old BP
  566. Xendif    ; LARGE_CODE
  567. END_OF_FILE
  568. if test 920 -ne `wc -c <'header.mac'`; then
  569.     echo shar: \"'header.mac'\" unpacked with wrong size!
  570. fi
  571. # end of 'header.mac'
  572. fi
  573. if test ! -d 'help' ; then
  574.     echo shar: Creating directory \"'help'\"
  575.     mkdir 'help'
  576. fi
  577. if test -f 'hp26.trm' -a "${1}" != "-c" ; then 
  578.   echo shar: Will not clobber existing file \"'hp26.trm'\"
  579. else
  580. echo shar: Extracting \"'hp26.trm'\" \(1692 characters\)
  581. sed "s/^X//" >'hp26.trm' <<'END_OF_FILE'
  582. X/* thanks to hplvlch!ch (Chuck Heller) for the HP2623A driver */
  583. X#define HP26_XMAX 512
  584. X#define HP26_YMAX 390
  585. X
  586. X#define HP26_XLAST (HP26_XMAX - 1)
  587. X#define HP26_YLAST (HP26_XMAX - 1)
  588. X
  589. X/* Assume a character size of 1, or a 7 x 10 grid. */
  590. X#define HP26_VCHAR    10
  591. X#define HP26_HCHAR    7
  592. X#define HP26_VTIC    4
  593. X#define HP26_HTIC    4
  594. X
  595. XHP26_init()
  596. X{
  597. X    /*    The HP2623A needs no initialization. */
  598. X}
  599. X
  600. X
  601. XHP26_graphics()
  602. X{
  603. X    /*    Clear and enable the display */
  604. X
  605. X    fputs("\033*daZ\033*dcZ",outfile);
  606. X}
  607. X
  608. X
  609. XHP26_text()
  610. X{
  611. X    fputs("\033*dT",outfile);    /* back to text mode */
  612. X}
  613. X
  614. X
  615. XHP26_linetype(linetype)
  616. Xint linetype;
  617. X{
  618. X#define    SOLID    1
  619. X#define LINE4    4
  620. X#define LINE5    5
  621. X#define LINE6    6
  622. X#define LINE8    8
  623. X#define    DOTS    7
  624. X#define LINE9    9
  625. X#define LINE10    10
  626. X
  627. Xstatic int map[2+9] = {    SOLID,    /* border */
  628. X                        DOTS,    /* axes */
  629. X                        SOLID,    /* plot 0 */
  630. X                        LINE4,    /* plot 1 */
  631. X                        LINE5,    /* plot 2 */
  632. X                        LINE6,    /* plot 3 */
  633. X                        LINE8,    /* plot 4 */
  634. X                        LINE9,    /* plot 5 */
  635. X                        LINE10,    /* plot 6 */
  636. X                        DOTS,    /* plot 7 */
  637. X                        SOLID    /* plot 8 */ };
  638. X
  639. X    if (linetype >= 9)
  640. X        linetype %= 9;
  641. X    fprintf(outfile,"\033*m%dB",map[linetype + 2]);
  642. X}
  643. X
  644. X
  645. XHP26_move(x,y)
  646. Xint x,y;
  647. X{
  648. X    fprintf(outfile,"\033*pa%d,%dZ",x,y);
  649. X}
  650. X
  651. X
  652. XHP26_vector(x,y)
  653. Xint x,y;
  654. X{
  655. X    fprintf(outfile,"\033*pb%d,%dZ",x,y);
  656. X}
  657. X
  658. X
  659. XHP26_lrput_text(row,str)
  660. Xint row;
  661. Xchar str[];
  662. X{
  663. X    HP26_move(HP26_XMAX-HP26_HTIC*2,HP26_VTIC*2+HP26_VCHAR*row);
  664. X    fputs("\033*dS",outfile);
  665. X    fprintf(outfile,"\033*m7Q\033*l%s\n",str);
  666. X    fputs("\033*dT",outfile);
  667. X}
  668. X
  669. X
  670. XHP26_ulput_text(row,str)
  671. Xint row;
  672. Xchar str[];
  673. X{
  674. X    HP26_move(HP26_HTIC*2,HP26_YMAX-HP26_VTIC*2-HP26_VCHAR*row);
  675. X    fputs("\033*dS",outfile);
  676. X    fprintf(outfile,"\033*m3Q\033*l%s\n",str);
  677. X    fputs("\033*dT",outfile);
  678. X}
  679. X
  680. X
  681. XHP26_reset()
  682. X{
  683. X}
  684. X
  685. X
  686. END_OF_FILE
  687. if test 1692 -ne `wc -c <'hp26.trm'`; then
  688.     echo shar: \"'hp26.trm'\" unpacked with wrong size!
  689. fi
  690. # end of 'hp26.trm'
  691. fi
  692. if test -f 'hp75.trm' -a "${1}" != "-c" ; then 
  693.   echo shar: Will not clobber existing file \"'hp75.trm'\"
  694. else
  695. echo shar: Extracting \"'hp75.trm'\" \(1415 characters\)
  696. sed "s/^X//" >'hp75.trm' <<'END_OF_FILE'
  697. X#define HP75_XMAX 6000
  698. X#define HP75_YMAX 6000
  699. X
  700. X#define HP75_XLAST (HP75_XMAX - 1)
  701. X#define HP75_YLAST (HP75_XMAX - 1)
  702. X
  703. X/* HP75_VCHAR, HP75_HCHAR  are not used */
  704. X#define HP75_VCHAR    (HP75_YMAX/20)    
  705. X#define HP75_HCHAR    (HP75_XMAX/20)        
  706. X#define HP75_VTIC    (HP75_YMAX/70)        
  707. X#define HP75_HTIC    (HP75_XMAX/75)        
  708. X
  709. XHP75_init()
  710. X{
  711. X    fprintf(outfile,
  712. X    "IN;\033.P1:SC0,%d,0,%d;\n;IP;SI0.2137,0.2812;\n",
  713. X        HP75_XMAX,HP75_YMAX);
  714. X/*     1      2  3       4             5    6  7
  715. X    1. turn on eavesdropping
  716. X    2. reset to power-up defaults
  717. X    3. enable XON/XOFF flow control
  718. X    4. set SCaling to 2000 x 2000
  719. X    5. rotate page 90 degrees
  720. X    6. ???
  721. X    7. set some character set stuff
  722. X*/
  723. X}
  724. X
  725. X
  726. XHP75_graphics()
  727. X{
  728. X/*         1
  729. X    fputs("\033.Y",outfile);
  730. X    1. enable eavesdropping
  731. X*/
  732. X}
  733. X
  734. X
  735. XHP75_text()
  736. X{
  737. X    fputs("NR;\033.Z",outfile);
  738. X/*         1  2
  739. X    1. go into 'view' mode
  740. X    2. disable plotter eavesdropping
  741. X*/
  742. X}
  743. X
  744. X
  745. XHP75_linetype(linetype)
  746. Xint linetype;
  747. X{
  748. X    fprintf(outfile,"SP%d;\n",(linetype+3)%8);
  749. X}
  750. X
  751. X
  752. XHP75_move(x,y)
  753. Xint x,y;
  754. X{
  755. X    fprintf(outfile,"PU%d,%d;\n",x,y);
  756. X}
  757. X
  758. X
  759. XHP75_vector(x,y)
  760. Xint x,y;
  761. X{
  762. X    fprintf(outfile,"PD%d,%d;\n",x,y);
  763. X}
  764. X
  765. X
  766. XHP75_lrput_text(row,str)
  767. Xint row;
  768. Xchar str[];
  769. X{
  770. X    HP75_move(HP75_XMAX-HP75_HTIC*2,HP75_VTIC*2+HP75_VCHAR*row);
  771. X    fprintf(outfile,"LO17;LB%s\003\n",str);
  772. X}
  773. X
  774. XHP75_ulput_text(row,str)
  775. Xint row;
  776. Xchar str[];
  777. X{
  778. X    HP75_move(HP75_HTIC*2,HP75_YMAX-HP75_VTIC*2-HP75_VCHAR*row);
  779. X    fprintf(outfile,"LO13;LB%s\003\n",str);
  780. X}
  781. X
  782. XHP75_reset()
  783. X{
  784. X}
  785. X
  786. X
  787. END_OF_FILE
  788. if test 1415 -ne `wc -c <'hp75.trm'`; then
  789.     echo shar: \"'hp75.trm'\" unpacked with wrong size!
  790. fi
  791. # end of 'hp75.trm'
  792. fi
  793. if test -f 'hpljet.trm' -a "${1}" != "-c" ; then 
  794.   echo shar: Will not clobber existing file \"'hpljet.trm'\"
  795. else
  796. echo shar: Extracting \"'hpljet.trm'\" \(6360 characters\)
  797. sed "s/^X//" >'hpljet.trm' <<'END_OF_FILE'
  798. X/*
  799. X** Hewlett-Packard Laserjet
  800. X** Driver written and copyrighted 1987 by
  801. X** Jyrki Yli-Nokari (jty@intrin.UUCP)
  802. X** Intrinsic, Ltd.
  803. X** 
  804. X** You may use this code for anything you like as long as
  805. X** you are not selling it and the credit is given and
  806. X** this message retained.
  807. X*/
  808. X
  809. X/*
  810. X** Here is the GNUPLOT HP Laserjet driver I promised to send to the net.
  811. X** Following is a set of diffs to the GNUPLOT version V1.1 term.c
  812. X** In case you don't have the patch program, you must insert the diffs
  813. X** by hand. This should be fairly easy with a proper editor
  814. X** since they are almost in one piece.
  815. X**
  816. X** Also there are some fixes to the HP26xx driver that was in the
  817. X** V1.1 distribution.
  818. X**
  819. X** To get the laserjet driver, add -DHPLJET to TERMFLAGS in Makefile
  820. X** (/DHPLJET in make.msc and HPLJET in compile.com).
  821. X**
  822. X** The driver consists of two parts: general raster plotting routines
  823. X** (#ifdef RASTER) and the laserjet driver using them (#ifdef HPLJET).
  824. X**
  825. X** The laserjet driver contains actually three different "terminal types":
  826. X** laserjet1, laserjet2 and laserjet3. The difference between them is the size
  827. X** of the picture "laserjet3" being the biggest.
  828. X*/
  829. X
  830. X/*
  831. X** NOTE:
  832. X** When sending the plot to the laserjet there must be absolutely
  833. X** NO character translation done by the operating system.
  834. X** Normally, in UNIX, the (operating system) terminal driver
  835. X** translates newlines to CR/LF pairs. This is called the "cooked mode".
  836. X** Some operating systems might add CR/LF pairs if they think there
  837. X** is a too long line. ALL THIS IS STRICTLY PROHIBITED.
  838. X** ALL DATA TO THE LASERJET MUST BE SENT WHEN THE LINE IS IN RAW MODE.
  839. X**
  840. X
  841. X/*
  842. X** The laserjet math is a pain since we have to deal with
  843. X** decipoints (720/inch), dots (300/inch), pixels (100-300/inch),
  844. X** characters (10/inch horiz., 6/inch vertic.) and the size of
  845. X** the plottable surface in A4 (about 7.8 inches horizontally).
  846. X** On top of this we also support different plot sizes!
  847. X*/
  848. X
  849. X#define HPLJET_PIXSIZE    (hpljet_pixel)
  850. X        /* Laserjet pixel size in laserjet minimum dots */
  851. X#define HPLJET_PPI (300/HPLJET_PIXSIZE)
  852. X        /* Laserjet raster scaling factor, Pixels Per Inch */
  853. X#define HPLJET_WIDTH 5600
  854. X        /* ~ Number of horizontal decipoints in A4 */
  855. X#define HPLJET_IN2DP(x) (720*(x))
  856. X        /* convert INches TO DeciPoints */
  857. X#define HPLJET_PX2DP(x) (HPLJET_IN2DP(x)/HPLJET_PPI)
  858. X        /* convert PiXels TO DeciPoints */
  859. X#define HPLJET_HC2DP(x) (72*(x))
  860. X        /* convert Horizontal Characters TO DeciPoints */
  861. X#define HPLJET_VC2DP(x) (120*(x))
  862. X        /* convert Vertical Characters TO DeciPoints */
  863. X#define HPLJET_LMARG ((HPLJET_WIDTH - HPLJET_PX2DP(HPLJETXMAX))/2)
  864. X        /* Picture left margin in decipoints */
  865. X#define HPLJET_RMARG ((HPLJET_WIDTH + HPLJET_PX2DP(HPLJETXMAX))/2)
  866. X        /* Picture right margin in decipoints */
  867. X#define HPLJETXMAX 640
  868. X        /* Number of pixels in X-axis */
  869. X#define HPLJETYMAX 640
  870. X        /* Number of pixels in Y-axis */
  871. X#define HPLJETXLAST (HPLJETXMAX - 1)
  872. X        /* Last valid X-pixel value */
  873. X#define HPLJETYLAST (HPLJETYMAX - 1)
  874. X        /* Last valid Y-pixel value */
  875. X
  876. X#define HPLJETVCHAR    (HPLJET_PPI/6)
  877. X        /* Vertical pixel size of the character font */
  878. X#define HPLJETHCHAR    (HPLJET_PPI/10)
  879. X        /* Horizontal pixel size of the character font */
  880. X#define HPLJET1VCHAR    (300/6)
  881. X        /* Vertical pixel size of the character font */
  882. X#define HPLJET1HCHAR    (300/10)
  883. X        /* Horizontal pixel size of the character font */
  884. X#define HPLJET2VCHAR    (150/6)
  885. X        /* Vertical pixel size of the character font */
  886. X#define HPLJET2HCHAR    (150/10)
  887. X        /* Horizontal pixel size of the character font */
  888. X#define HPLJET3VCHAR    (100/6)
  889. X        /* Vertical pixel size of the character font */
  890. X#define HPLJET3HCHAR    (100/10)
  891. X        /* Horizontal pixel size of the character font */
  892. X/*
  893. X** (I guess) VTIC and HTIC are used as
  894. X** "small units that look like equal length".
  895. X** They determine (at least) the length of "bars" in axises and
  896. X** the size of plotting symbols.
  897. X*/
  898. X#define HPLJETVTIC        6
  899. X#define HPLJETHTIC        6
  900. X
  901. X/*
  902. X** We use laserjet1, laserjet2 and laserjet3 for different
  903. X** pixel sizes of the picture (1 is the smallest).
  904. X** The size of the text, however, remains the same.
  905. X** These three terminal types use mostly the same
  906. X** functions, only the init-function determines the size of the picture.
  907. X** Also, the h_char and v_char are different, but they are
  908. X** not used.
  909. X*/
  910. X
  911. X/*
  912. X** Initialize (once) for graphics
  913. X*/
  914. Xstatic int hpljet_pixel = 3;
  915. X
  916. XHPLJET1init()
  917. X{
  918. X    hpljet_pixel = 1;
  919. X}
  920. X
  921. XHPLJET2init()
  922. X{
  923. X    hpljet_pixel = 2;
  924. X}
  925. X
  926. XHPLJET3init()
  927. X{
  928. X    hpljet_pixel = 3;
  929. X}
  930. X
  931. XHPLJETmove(x, y)
  932. X{
  933. X    r_move((unsigned)x, (unsigned)y);
  934. X}
  935. X
  936. XHPLJETvector(x, y)
  937. X{
  938. X    r_draw((unsigned)x, (unsigned)y, (pixel)1);
  939. X}
  940. X
  941. X/*
  942. X** Enter graphics mode:
  943. X**    - allocate raster buffer
  944. X**    - set resolution
  945. X*/
  946. XHPLJETgraphics()
  947. X{
  948. X    r_makeraster(HPLJETXMAX, HPLJETYMAX);
  949. X    fprintf(outfile,"\033*t%dR", HPLJET_PPI);
  950. X/*                                 1
  951. X**    1. Set resolution pixels/inch
  952. X*/
  953. X}
  954. X
  955. X/*
  956. X** (re-)enter text mode,
  957. X** output raster and deallocate it.
  958. X*/
  959. XHPLJETtext()
  960. X{
  961. X    int x, y;
  962. X    unsigned v, i;
  963. X
  964. X    fprintf(outfile, "\033&a%dH\033&a%dV", HPLJET_LMARG, HPLJET_VC2DP(2));
  965. X    fprintf(outfile, "\033*r1A");
  966. X    for (y = r_ysize-1; y >= 0; y--) {
  967. X        fprintf(outfile, "\033*b%dW", r_xsize/8);
  968. X        for (x = 0; x < r_xsize; x += 8) {
  969. X            v = 0;
  970. X            for (i = 0; i < 8; i++) {
  971. X                v = (v << 1) | r_getpixel((unsigned)x + i, (unsigned)y);
  972. X            }
  973. X            putc((char)v, outfile);
  974. X        }
  975. X    }
  976. X    r_freeraster();
  977. X    fprintf(outfile, "\033*rB\f");
  978. X}
  979. X
  980. X/*
  981. X** Select line type [-2:8]
  982. X** line types:
  983. X**    -2 = border line
  984. X**    -1 = x/y axis line
  985. X**    0-8 = function plot lines.
  986. X**    Dummy function here.
  987. X*/
  988. XHPLJETlinetype(linetype)
  989. Xint linetype;
  990. X{
  991. X}
  992. X
  993. X/*
  994. X** Put text "str" to the lower right corner of the screen.
  995. X** "row" is the row number [0:1].
  996. X** Actually in the laserjet, put the text above the upper right corner.
  997. X*/
  998. XHPLJETlrput_text(row,str)
  999. Xunsigned int row;
  1000. Xchar str[];
  1001. X{
  1002. X    
  1003. X    fprintf(outfile, "\033&a%dH\033&a%dV",
  1004. X            HPLJET_RMARG - HPLJET_HC2DP(strlen(str)), HPLJET_VC2DP(row));
  1005. X    fputs(str, outfile);
  1006. X}
  1007. X
  1008. X/*
  1009. X** Put text "str" to the upper left corner of the screen.
  1010. X** "row" is the (serial) number of function to be plotted.
  1011. X** Actually in the laserjet, put the text under the lower left corner.
  1012. X*/
  1013. XHPLJETulput_text(row,str)
  1014. Xunsigned int row;
  1015. Xchar str[];
  1016. X{
  1017. X    fprintf(outfile, "\033&a%dH\033&a%dV",
  1018. X            HPLJET_LMARG,
  1019. X            HPLJET_VC2DP(row+3)+HPLJET_PX2DP(HPLJETYMAX));
  1020. X    fputs(str, outfile);
  1021. X}
  1022. X
  1023. X/*
  1024. X** RETURN to normal mode (exit gnuplot)
  1025. X*/
  1026. XHPLJETreset()
  1027. X{
  1028. X}
  1029. X
  1030. END_OF_FILE
  1031. if test 6360 -ne `wc -c <'hpljet.trm'`; then
  1032.     echo shar: \"'hpljet.trm'\" unpacked with wrong size!
  1033. fi
  1034. # end of 'hpljet.trm'
  1035. fi
  1036. if test -f 'hrcgraph.asm' -a "${1}" != "-c" ; then 
  1037.   echo shar: Will not clobber existing file \"'hrcgraph.asm'\"
  1038. else
  1039. echo shar: Extracting \"'hrcgraph.asm'\" \(7978 characters\)
  1040. sed "s/^X//" >'hrcgraph.asm' <<'END_OF_FILE'
  1041. XTITLE    Hercules graphics module
  1042. X
  1043. X;    Michael Gordon - 8-Dec-86
  1044. X;
  1045. X; Certain routines were taken from the Hercules BIOS of    Dave Tutelman - 8/86
  1046. X; Others came from pcgraph.asm included in GNUPLOT by Colin Kelley
  1047. X;
  1048. X; modified slightly by Colin Kelley - 22-Dec-86
  1049. X;    added header.mac, parameterized declarations
  1050. X; added dgroup: in HVmodem to reach HCh_Parms and HGr_Parms - 30-Jan-87
  1051. X
  1052. Xinclude header.mac
  1053. X
  1054. Xif1
  1055. Xinclude lineproc.mac
  1056. Xendif
  1057. X
  1058. X
  1059. XGPg1_Base equ 0B800h    ; Graphics page 1 base address
  1060. X
  1061. X_text    segment
  1062. X
  1063. X    public _H_line, _H_color, _H_mask, _HVmode, _H_puts
  1064. X
  1065. Xhpixel    proc near
  1066. X    ror word ptr bmask,1
  1067. X    jc cont
  1068. X    ret
  1069. Xcont:
  1070. X    push ax
  1071. X    push bx
  1072. X    push cx
  1073. X    push dx
  1074. X    push si
  1075. X    mov cx,ax        ; x
  1076. X    mov dx,bx        ; y
  1077. X;
  1078. X; [couldn't this be done faster with a lookup table? -cdk]
  1079. X;
  1080. X    ; first compute the address of byte to be modified
  1081. X    ; = 90*[row/4] + [col/8] + 2^D*[row/4] + 2^F*page
  1082. X    mov    bh,cl        ; col (low order) in BH
  1083. X    mov    bl,dl        ; row (low order) in BL
  1084. X    and    bx,0703H    ; mask the col & row remainders
  1085. XIFDEF iAPX286
  1086. X    shr    cx,3        ; col / 8
  1087. X    shr    dx,2        ; row / 4
  1088. X    mov    al,90
  1089. X    mul    dx        ; AX = 90*[ row/4 ]
  1090. X    add    ax,cx        ;  ... + col/8
  1091. X    shl    bl,5        ; align row remainder
  1092. XELSE            ; same as above, obscure but fast for 8086
  1093. X    shr    cx,1        ; divide col by 8
  1094. X    shr    cx,1
  1095. X    shr    cx,1
  1096. X    shr    dx,1        ; divide row by 4
  1097. X    shr    dx,1
  1098. X    shl    dx,1        ; begin fast multiply by 90 (1011010 B)
  1099. X    mov    ax,dx
  1100. X    shl    dx,1
  1101. X    shl    dx,1
  1102. X    add    ax,dx
  1103. X    shl    dx,1
  1104. X    add    ax,dx
  1105. X    shl    dx,1
  1106. X    shl    dx,1
  1107. X    add    ax,dx        ; end fast multiply by 90
  1108. X    add    ax,cx        ; add on the col/8
  1109. X    shl    bl,1        ; align row remainder
  1110. X    shl    bl,1
  1111. X    shl    bl,1
  1112. X    shl    bl,1
  1113. X    shl    bl,1
  1114. XENDIF
  1115. X    add    ah,bl        ; use aligned row remainder
  1116. Xend_adr_calc:            ; address of byte is now in AX
  1117. X    mov    dx,GPg1_Base    ; base of pixel display to DX
  1118. X    mov    es,dx        ; ...and thence to segment reg
  1119. X    mov    si,ax        ; address of byte w/ pixel to index reg
  1120. X    mov    cl,bh        ; bit addr in byte
  1121. X    mov    al,80H        ; '1000 0000' in AL 
  1122. X    shr    al,cl        ; shift mask to line up with bit to read/write
  1123. Xset_pix:            ; set the pixel
  1124. X    or    es:[si],al    ; or the mask with the right byte
  1125. X    pop si
  1126. X    pop dx
  1127. X    pop cx
  1128. X    pop bx
  1129. X    pop ax
  1130. X    ret
  1131. Xhpixel endp
  1132. X
  1133. Xlineproc _H_line, hpixel
  1134. X
  1135. X;
  1136. X; clear - clear page 1 of the screen buffer to zero (effectively, blank
  1137. X;    the screen)
  1138. X;
  1139. Xclear   proc near
  1140. X    push es
  1141. X    push ax
  1142. X    push cx
  1143. X    push di
  1144. X    mov ax, GPg1_Base
  1145. X    mov es, ax
  1146. X    xor di, di
  1147. X    mov cx, 4000h
  1148. X    xor ax, ax
  1149. X    cld
  1150. X    rep stosw            ; zero out screen page
  1151. X    pop di
  1152. X    pop cx
  1153. X    pop ax
  1154. X    pop es
  1155. X    ret
  1156. Xclear    endp
  1157. X
  1158. Xbeginproc _H_color
  1159. X    push bp
  1160. X    mov bp,sp
  1161. X    mov al,[bp+X]            ; color
  1162. X    mov byte ptr color,al
  1163. X    pop bp
  1164. X    ret
  1165. X_H_color endp
  1166. X
  1167. Xbeginproc _H_mask
  1168. X    push bp
  1169. X    mov bp,sp
  1170. X    mov ax,[bp+X]            ; mask
  1171. X    mov word ptr bmask,ax
  1172. X    pop bp
  1173. X    ret
  1174. X_H_mask endp
  1175. X
  1176. XHCtrl_Port    equ    03B8H    ; Hercules 6845 control port IO addr
  1177. XHIndx_Port    equ    03B4H    ; Hercules 6845 index port IO addr
  1178. XHScrn_Enable    equ    008h    ; Control port bit to enable video
  1179. XHCh_Mode    equ    020h    ; Character output mode
  1180. XHGr_Mode    equ    082h    ; Graphics output mode page 1
  1181. X
  1182. Xparm_count equ 12
  1183. X
  1184. Xbeginproc _HVmode
  1185. X    push bp
  1186. X    mov bp, sp
  1187. X    push si
  1188. X    mov ax, [bp+X]
  1189. X    or ah, al
  1190. X    mov al, HCh_Mode        ; Assume character mode is wanted
  1191. X    mov si, offset dgroup:HCh_Parms
  1192. X    cmp ah, 0            ; nonzero means switch to graphics
  1193. X    jz vmode_ok
  1194. X    call near ptr clear        ; clear the graphics page
  1195. X    mov al, HGr_Mode
  1196. X    mov si, offset dgroup:HGr_Parms
  1197. Xvmode_ok:
  1198. X    mov dx, HCtrl_Port
  1199. X    out dx, al            ; Set Hercules board to proper mode
  1200. X    call near ptr setParms        ; Set the 6845 parameters
  1201. X    or al, HScrn_Enable        ; Enable the video output
  1202. X    out dx, al
  1203. X    pop si
  1204. X    pop bp
  1205. X    ret
  1206. X_HVmode    endp
  1207. X
  1208. XsetParms proc near        ; Send 6845 parms to Hercules board
  1209. X    push ax
  1210. X    push dx
  1211. X    push si            
  1212. X    mov dx, HIndx_Port    ; Index port addr -> DX
  1213. X    mov ah, 0        ; 0 -> parameter counter
  1214. Xsp_loop:
  1215. X    mov al, ah
  1216. X    out dx, al        ; output to 6845 addr register
  1217. X    inc dx            ; next output to data register
  1218. X    mov al, [si]        ; next control byte -> al
  1219. X    inc si
  1220. X    out dx, al        ; output control byte
  1221. X    dec dx            ; 6845 index addr -> dx
  1222. X    inc ah            ; bump addr
  1223. X    cmp ah, parm_count
  1224. X    jnz sp_loop
  1225. X    pop si
  1226. X    pop dx
  1227. X    pop ax
  1228. X    ret
  1229. XsetParms endp
  1230. X
  1231. X; H_puts - print text in graphics mode
  1232. X;
  1233. X;    cx = row
  1234. X;    bx = column
  1235. X;    si = address of string (null terminated) to print
  1236. X
  1237. Xbeginproc _H_puts
  1238. X    push bp
  1239. X    mov bp, sp
  1240. X    push si
  1241. X    push ds
  1242. X    mov si, [bp+X]            ; string offset
  1243. X
  1244. Xifdef LARGE_DATA
  1245. X    mov ds, [bp+X+2]        ; string segment
  1246. X    mov cx, [bp+X+4]        ; row
  1247. X    mov bx, [bp+X+6]        ; col
  1248. Xelse
  1249. X    mov cx, [bp+X+2]        ; row
  1250. X    mov bx, [bp+X+4]        ; col
  1251. Xendif
  1252. X
  1253. Xploop:    lodsb                ; get next char
  1254. X    or    al, al            ; end of display?
  1255. X    je    pdone
  1256. X    call near ptr display
  1257. X    inc    bx            ; bump to next column
  1258. X    jmp    ploop
  1259. Xpdone:    pop ds
  1260. X    pop si
  1261. X    pop bp
  1262. X    ret
  1263. X_H_puts    endp
  1264. X
  1265. X;
  1266. X; display - output an 8x8 character from the IBM ROM to the Herc board
  1267. X;
  1268. X; AX = char, BX = column (0-89), CX = row(0-42)  ** all preserved **
  1269. X;
  1270. XCON8    db    8
  1271. XCON180    db    180
  1272. XIBMROM    equ    0F000h
  1273. XCHARTAB    equ    0FA6Eh
  1274. X
  1275. Xdisplay    proc near
  1276. X    push    ds            ; save the lot
  1277. X    push    es
  1278. X    push    ax
  1279. X    push    bx
  1280. X    push    cx
  1281. X    push    dx
  1282. X    push    si
  1283. X    push    di
  1284. X
  1285. X; setup ds -> IBM ROM, and si -> index into IBM ROM character table located
  1286. X;    at 0fa6eh in the ROM
  1287. X
  1288. X    and    ax, 07fh
  1289. X    mul    cs:CON8            ; mult by 8 bytes of table per char
  1290. X    mov    si, ax
  1291. X    mov    ax, IBMROM
  1292. X    mov    ds, ax
  1293. X    assume    ds:nothing
  1294. X    add    si, CHARTAB        ; add offset of character table
  1295. X
  1296. X; compute index into Hercules screen memory for scan line 0.  The remaining
  1297. X;    seven scan lines are all at fixed offsets from the first.
  1298. X;
  1299. X;    Since graphics mode treats the screen as sets of 16x4 "characters",
  1300. X;    we need to map an 8x8 real character onto the front or back of
  1301. X;    a pair of graphics "characters".  The first four scan lines of our
  1302. X;    8x8 character will map to the top graphics "character", and the second
  1303. X;    four scan lines map to the graphics character on the "line" (4 scan
  1304. X;    lines high) below it.
  1305. X;
  1306. X;    For some exotic hardware reason (probably speed), all scan line 0
  1307. X;    bits (i.e. every fourth scan line) are stored in memory locations
  1308. X;    0-2000h in the screen buffer.  All scan line 1 bits are stored
  1309. X;    2000h-4000h.  Within these banks, they are stored by rows.  The first
  1310. X;    scan line on the screen (scan line 0 of graphics character row 0)
  1311. X;    is the first 45 words of memory in the screen buffer.  The next 45
  1312. X;    words are the first scan line graphics row 1, and since graphics
  1313. X;    "characters" are 4 bits high, this second scan line is physically
  1314. X;    the fifth scan line displayed on the screen.
  1315. X;
  1316. X;    SO, to display an 8x8 character, the 1st and 5th rows of dots are
  1317. X;    both scan line 0 of the graphics "character", the 2nd and 6th are
  1318. X;    scan line 1, and so on.
  1319. X;
  1320. X;    The column (0-89) tells which byte in a scan line we need to load.
  1321. X;    Since it takes two rows of graphics characters to hold one row of
  1322. X;    our characters, column+90 is a index to scan line 4 rows of pixels
  1323. X;    higher (n+4).  Thus 180 bytes of screen memory in any bank (0h, 2000h,
  1324. X;    4000h, 6000h) represent a row of 8x8 characters.
  1325. X;    
  1326. X;    The starting location in screen memory for the first scan line of
  1327. X;    a character to be displayed will be:      (row*180)+column
  1328. X;    The 5th scan line will be at:        (row*180)+column+90
  1329. X;
  1330. X;    The second and 6th scan lines will be at the above offsets plus
  1331. X;    the bank offset of 2000h.  The third and 7th, add 4000h and finally
  1332. X;    the 4th and 8th, add 6000h.
  1333. X;
  1334. X    mov    ax, GPg1_Base
  1335. X    mov    es, ax            ; es = hercules page 0
  1336. X    mov    ax, cx            ; get row
  1337. X    mul    cs:CON180        ; mult by 180(10)
  1338. X    mov    di, ax            ; di = index reg
  1339. X    cld                ; insure right direction
  1340. X
  1341. X;output 8 segments of character to video ram
  1342. X
  1343. X    lodsb                ; line 0
  1344. X    mov    es:[di+bx], al
  1345. X    lodsb
  1346. X    mov    es:[di+bx+2000h], al    ; line 1
  1347. X    lodsb
  1348. X    mov    es:[di+bx+4000h], al    ; line 2
  1349. X    lodsb
  1350. X    mov    es:[di+bx+6000h], al    ; line 3
  1351. X    lodsb
  1352. X    mov    es:[di+bx+90], al    ; line 4
  1353. X    lodsb
  1354. X    mov    es:[di+bx+2000h+90], al    ; line 5
  1355. X    lodsb
  1356. X    mov    es:[di+bx+4000h+90], al    ; line 6
  1357. X    lodsb
  1358. X    mov    es:[di+bx+6000h+90], al    ; line 7
  1359. X
  1360. X    pop    di
  1361. X    pop    si
  1362. X    pop    dx
  1363. X    pop    cx
  1364. X    pop    bx
  1365. X    pop    ax
  1366. X    pop    es
  1367. X    pop    ds
  1368. X    ret
  1369. Xdisplay    endp
  1370. X
  1371. X_text    ends
  1372. X
  1373. X_data    segment
  1374. Xbmask    dw -1
  1375. Xcolor    db 1
  1376. X_data    ends
  1377. X
  1378. Xconst    segment
  1379. XHCh_Parms db     61H, 50H, 52H, 0FH, 19H, 06H, 19H, 19H, 02H, 0DH, 0BH, 0CH
  1380. XHGr_Parms db    35H, 2DH, 2EH, 07H, 5BH, 02H, 57H, 57H, 02H, 03H, 00H, 00H
  1381. Xconst    ends
  1382. X
  1383. X    end
  1384. X---------------------------end HRCGRAPH.ASM-------------------------------
  1385. X
  1386. X
  1387. END_OF_FILE
  1388. if test 7978 -ne `wc -c <'hrcgraph.asm'`; then
  1389.     echo shar: \"'hrcgraph.asm'\" unpacked with wrong size!
  1390. fi
  1391. # end of 'hrcgraph.asm'
  1392. fi
  1393. if test -f 'internal.c' -a "${1}" != "-c" ; then 
  1394.   echo shar: Will not clobber existing file \"'internal.c'\"
  1395. else
  1396. echo shar: Extracting \"'internal.c'\" \(13596 characters\)
  1397. sed "s/^X//" >'internal.c' <<'END_OF_FILE'
  1398. X/*
  1399. X *
  1400. X *    G N U P L O T  --  internal.c
  1401. X *
  1402. X *  Copyright (C) 1986, 1987  Colin Kelley, Thomas Williams
  1403. X *
  1404. X *  You may use this code as you wish if credit is given and this message
  1405. X *  is retained.
  1406. X *
  1407. X *  Please e-mail any useful additions to vu-vlsi!plot so they may be
  1408. X *  included in later releases.
  1409. X *
  1410. X *  This file should be edited with 4-column tabs!  (:set ts=4 sw=4 in vi)
  1411. X */
  1412. X
  1413. X#include <math.h>
  1414. X#include <stdio.h>
  1415. X#include "plot.h"
  1416. X
  1417. Xextern BOOLEAN undefined;
  1418. X
  1419. Xchar *strcpy();
  1420. X
  1421. Xstruct value *pop(), *complex(), *integer();
  1422. Xdouble magnitude(), angle(), real();
  1423. X
  1424. Xstruct value stack[STACK_DEPTH];
  1425. X
  1426. Xint s_p = -1;   /* stack pointer */
  1427. X
  1428. X
  1429. X/*
  1430. X * System V and MSC 4.0 call this when they wants to print an error message.
  1431. X * Don't!
  1432. X */
  1433. Xmatherr()
  1434. X{
  1435. X    return (undefined = TRUE);        /* don't print error message */
  1436. X}
  1437. X
  1438. X
  1439. Xreset_stack()
  1440. X{
  1441. X    s_p = -1;
  1442. X}
  1443. X
  1444. X
  1445. Xcheck_stack()    /* make sure stack's empty */
  1446. X{
  1447. X    if (s_p != -1)
  1448. X        fprintf(stderr,"\nwarning:  internal error--stack not empty!\n");
  1449. X}
  1450. X
  1451. X
  1452. Xstruct value *pop(x)
  1453. Xstruct value *x;
  1454. X{
  1455. X    if (s_p  < 0 )
  1456. X        int_error("stack underflow",NO_CARET);
  1457. X    *x = stack[s_p--];
  1458. X    return(x);
  1459. X}
  1460. X
  1461. X
  1462. Xpush(x)
  1463. Xstruct value *x;
  1464. X{
  1465. X    if (s_p == STACK_DEPTH - 1)
  1466. X        int_error("stack overflow",NO_CARET);
  1467. X    stack[++s_p] = *x;
  1468. X}
  1469. X
  1470. X
  1471. X#define ERR_VAR "undefined variable: "
  1472. X
  1473. Xf_push(x)
  1474. Xunion argument *x;        /* contains pointer to value to push; */
  1475. X{
  1476. Xstatic char err_str[sizeof(ERR_VAR) + MAX_ID_LEN] = ERR_VAR;
  1477. Xstruct udvt_entry *udv;
  1478. X
  1479. X    udv = x->udv_arg;
  1480. X    if (udv->udv_undef) {     /* undefined */
  1481. X        (void) strcpy(&err_str[sizeof(ERR_VAR) - 1], udv->udv_name);
  1482. X        int_error(err_str,NO_CARET);
  1483. X    }
  1484. X    push(&(udv->udv_value));
  1485. X}
  1486. X
  1487. X
  1488. Xf_pushc(x)
  1489. Xunion argument *x;
  1490. X{
  1491. X    push(&(x->v_arg));
  1492. X}
  1493. X
  1494. X
  1495. Xf_pushd(x)
  1496. Xunion argument *x;
  1497. X{
  1498. X    push(&(x->udf_arg->dummy_value));
  1499. X}
  1500. X
  1501. X
  1502. X#define ERR_FUN "undefined function: "
  1503. X
  1504. Xf_call(x)  /* execute a udf */
  1505. Xunion argument *x;
  1506. X{
  1507. Xstatic char err_str[sizeof(ERR_FUN) + MAX_ID_LEN] = ERR_FUN;
  1508. Xregister struct udft_entry *udf;
  1509. X
  1510. X    udf = x->udf_arg;
  1511. X    if (!udf->at) { /* undefined */
  1512. X        (void) strcpy(&err_str[sizeof(ERR_FUN) - 1],
  1513. X                udf->udf_name);
  1514. X        int_error(err_str,NO_CARET);
  1515. X    }
  1516. X    (void) pop(&(udf->dummy_value));
  1517. X
  1518. X    execute_at(udf->at);
  1519. X}
  1520. X
  1521. X
  1522. Xstatic int_check(v)
  1523. Xstruct value *v;
  1524. X{
  1525. X    if (v->type != INT)
  1526. X        int_error("non-integer passed to boolean operator",NO_CARET);
  1527. X}
  1528. X
  1529. X
  1530. Xf_lnot()
  1531. X{
  1532. Xstruct value a;
  1533. X    int_check(pop(&a));
  1534. X    push(integer(&a,!a.v.int_val) );
  1535. X}
  1536. X
  1537. X
  1538. Xf_bnot()
  1539. X{
  1540. Xstruct value a;
  1541. X    int_check(pop(&a));
  1542. X    push( integer(&a,~a.v.int_val) );
  1543. X}
  1544. X
  1545. X
  1546. Xf_bool()
  1547. X{            /* converts top-of-stack to boolean */
  1548. X    int_check(&top_of_stack);
  1549. X    top_of_stack.v.int_val = !!top_of_stack.v.int_val;
  1550. X}
  1551. X
  1552. X
  1553. Xf_lor()
  1554. X{
  1555. Xstruct value a,b;
  1556. X    int_check(pop(&b));
  1557. X    int_check(pop(&a));
  1558. X    push( integer(&a,a.v.int_val || b.v.int_val) );
  1559. X}
  1560. X
  1561. Xf_land()
  1562. X{
  1563. Xstruct value a,b;
  1564. X    int_check(pop(&b));
  1565. X    int_check(pop(&a));
  1566. X    push( integer(&a,a.v.int_val && b.v.int_val) );
  1567. X}
  1568. X
  1569. X
  1570. Xf_bor()
  1571. X{
  1572. Xstruct value a,b;
  1573. X    int_check(pop(&b));
  1574. X    int_check(pop(&a));
  1575. X    push( integer(&a,a.v.int_val | b.v.int_val) );
  1576. X}
  1577. X
  1578. X
  1579. Xf_xor()
  1580. X{
  1581. Xstruct value a,b;
  1582. X    int_check(pop(&b));
  1583. X    int_check(pop(&a));
  1584. X    push( integer(&a,a.v.int_val ^ b.v.int_val) );
  1585. X}
  1586. X
  1587. X
  1588. Xf_band()
  1589. X{
  1590. Xstruct value a,b;
  1591. X    int_check(pop(&b));
  1592. X    int_check(pop(&a));
  1593. X    push( integer(&a,a.v.int_val & b.v.int_val) );
  1594. X}
  1595. X
  1596. X
  1597. Xf_uminus()
  1598. X{
  1599. Xstruct value a;
  1600. X    (void) pop(&a);
  1601. X    switch(a.type) {
  1602. X        case INT:
  1603. X            a.v.int_val = -a.v.int_val;
  1604. X            break;
  1605. X        case CMPLX:
  1606. X            a.v.cmplx_val.real =
  1607. X                -a.v.cmplx_val.real;
  1608. X            a.v.cmplx_val.imag =
  1609. X                -a.v.cmplx_val.imag;
  1610. X    }
  1611. X    push(&a);
  1612. X}
  1613. X
  1614. X
  1615. Xf_eq() /* note: floating point equality is rare because of roundoff error! */
  1616. X{
  1617. Xstruct value a, b;
  1618. X    register int result;
  1619. X    (void) pop(&b);
  1620. X    (void) pop(&a);
  1621. X    switch(a.type) {
  1622. X        case INT:
  1623. X            switch (b.type) {
  1624. X                case INT:
  1625. X                    result = (a.v.int_val ==
  1626. X                        b.v.int_val);
  1627. X                    break;
  1628. X                case CMPLX:
  1629. X                    result = (a.v.int_val ==
  1630. X                        b.v.cmplx_val.real &&
  1631. X                       b.v.cmplx_val.imag == 0.0);
  1632. X            }
  1633. X            break;
  1634. X        case CMPLX:
  1635. X            switch (b.type) {
  1636. X                case INT:
  1637. X                    result = (b.v.int_val == a.v.cmplx_val.real &&
  1638. X                       a.v.cmplx_val.imag == 0.0);
  1639. X                    break;
  1640. X                case CMPLX:
  1641. X                    result = (a.v.cmplx_val.real==
  1642. X                        b.v.cmplx_val.real &&
  1643. X                        a.v.cmplx_val.imag==
  1644. X                        b.v.cmplx_val.imag);
  1645. X            }
  1646. X    }
  1647. X    push(integer(&a,result));
  1648. X}
  1649. X
  1650. X
  1651. Xf_ne()
  1652. X{
  1653. Xstruct value a, b;
  1654. X    register int result;
  1655. X    (void) pop(&b);
  1656. X    (void) pop(&a);
  1657. X    switch(a.type) {
  1658. X        case INT:
  1659. X            switch (b.type) {
  1660. X                case INT:
  1661. X                    result = (a.v.int_val !=
  1662. X                        b.v.int_val);
  1663. X                    break;
  1664. X                case CMPLX:
  1665. X                    result = (a.v.int_val !=
  1666. X                        b.v.cmplx_val.real ||
  1667. X                       b.v.cmplx_val.imag != 0.0);
  1668. X            }
  1669. X            break;
  1670. X        case CMPLX:
  1671. X            switch (b.type) {
  1672. X                case INT:
  1673. X                    result = (b.v.int_val !=
  1674. X                        a.v.cmplx_val.real ||
  1675. X                       a.v.cmplx_val.imag != 0.0);
  1676. X                    break;
  1677. X                case CMPLX:
  1678. X                    result = (a.v.cmplx_val.real !=
  1679. X                        b.v.cmplx_val.real ||
  1680. X                        a.v.cmplx_val.imag !=
  1681. X                        b.v.cmplx_val.imag);
  1682. X            }
  1683. X    }
  1684. X    push(integer(&a,result));
  1685. X}
  1686. X
  1687. Xf_gt()
  1688. X{
  1689. Xstruct value a, b;
  1690. X    register int result;
  1691. X    (void) pop(&b);
  1692. X    (void) pop(&a);
  1693. X    switch(a.type) {
  1694. X        case INT:
  1695. X            switch (b.type) {
  1696. X                case INT:
  1697. X                    result = (a.v.int_val >
  1698. X                        b.v.int_val);
  1699. X                    break;
  1700. X                case CMPLX:
  1701. X                    result = (a.v.int_val >
  1702. X                        b.v.cmplx_val.real);
  1703. X            }
  1704. X            break;
  1705. X        case CMPLX:
  1706. X            switch (b.type) {
  1707. X                case INT:
  1708. X                    result = (a.v.cmplx_val.real >
  1709. X                        b.v.int_val);
  1710. X                    break;
  1711. X                case CMPLX:
  1712. X                    result = (a.v.cmplx_val.real >
  1713. X                        b.v.cmplx_val.real);
  1714. X            }
  1715. X    }
  1716. X    push(integer(&a,result));
  1717. X}
  1718. X
  1719. X
  1720. Xf_lt()
  1721. X{
  1722. Xstruct value a, b;
  1723. X    register int result;
  1724. X    (void) pop(&b);
  1725. X    (void) pop(&a);
  1726. X    switch(a.type) {
  1727. X        case INT:
  1728. X            switch (b.type) {
  1729. X                case INT:
  1730. X                    result = (a.v.int_val <
  1731. X                        b.v.int_val);
  1732. X                    break;
  1733. X                case CMPLX:
  1734. X                    result = (a.v.int_val <
  1735. X                        b.v.cmplx_val.real);
  1736. X            }
  1737. X            break;
  1738. X        case CMPLX:
  1739. X            switch (b.type) {
  1740. X                case INT:
  1741. X                    result = (a.v.cmplx_val.real <
  1742. X                        b.v.int_val);
  1743. X                    break;
  1744. X                case CMPLX:
  1745. X                    result = (a.v.cmplx_val.real <
  1746. X                        b.v.cmplx_val.real);
  1747. X            }
  1748. X    }
  1749. X    push(integer(&a,result));
  1750. X}
  1751. X
  1752. X
  1753. Xf_ge()
  1754. X{
  1755. Xstruct value a, b;
  1756. X    register int result;
  1757. X    (void) pop(&b);
  1758. X    (void) pop(&a);
  1759. X    switch(a.type) {
  1760. X        case INT:
  1761. X            switch (b.type) {
  1762. X                case INT:
  1763. X                    result = (a.v.int_val >=
  1764. X                        b.v.int_val);
  1765. X                    break;
  1766. X                case CMPLX:
  1767. X                    result = (a.v.int_val >=
  1768. X                        b.v.cmplx_val.real);
  1769. X            }
  1770. X            break;
  1771. X        case CMPLX:
  1772. X            switch (b.type) {
  1773. X                case INT:
  1774. X                    result = (a.v.cmplx_val.real >=
  1775. X                        b.v.int_val);
  1776. X                    break;
  1777. X                case CMPLX:
  1778. X                    result = (a.v.cmplx_val.real >=
  1779. X                        b.v.cmplx_val.real);
  1780. X            }
  1781. X    }
  1782. X    push(integer(&a,result));
  1783. X}
  1784. X
  1785. X
  1786. Xf_le()
  1787. X{
  1788. Xstruct value a, b;
  1789. X    register int result;
  1790. X    (void) pop(&b);
  1791. X    (void) pop(&a);
  1792. X    switch(a.type) {
  1793. X        case INT:
  1794. X            switch (b.type) {
  1795. X                case INT:
  1796. X                    result = (a.v.int_val <=
  1797. X                        b.v.int_val);
  1798. X                    break;
  1799. X                case CMPLX:
  1800. X                    result = (a.v.int_val <=
  1801. X                        b.v.cmplx_val.real);
  1802. X            }
  1803. X            break;
  1804. X        case CMPLX:
  1805. X            switch (b.type) {
  1806. X                case INT:
  1807. X                    result = (a.v.cmplx_val.real <=
  1808. X                        b.v.int_val);
  1809. X                    break;
  1810. X                case CMPLX:
  1811. X                    result = (a.v.cmplx_val.real <=
  1812. X                        b.v.cmplx_val.real);
  1813. X            }
  1814. X    }
  1815. X    push(integer(&a,result));
  1816. X}
  1817. X
  1818. X
  1819. Xf_plus()
  1820. X{
  1821. Xstruct value a, b, result;
  1822. X    (void) pop(&b);
  1823. X    (void) pop(&a);
  1824. X    switch(a.type) {
  1825. X        case INT:
  1826. X            switch (b.type) {
  1827. X                case INT:
  1828. X                    (void) integer(&result,a.v.int_val +
  1829. X                        b.v.int_val);
  1830. X                    break;
  1831. X                case CMPLX:
  1832. X                    (void) complex(&result,a.v.int_val +
  1833. X                        b.v.cmplx_val.real,
  1834. X                       b.v.cmplx_val.imag);
  1835. X            }
  1836. X            break;
  1837. X        case CMPLX:
  1838. X            switch (b.type) {
  1839. X                case INT:
  1840. X                    (void) complex(&result,b.v.int_val +
  1841. X                        a.v.cmplx_val.real,
  1842. X                       a.v.cmplx_val.imag);
  1843. X                    break;
  1844. X                case CMPLX:
  1845. X                    (void) complex(&result,a.v.cmplx_val.real+
  1846. X                        b.v.cmplx_val.real,
  1847. X                        a.v.cmplx_val.imag+
  1848. X                        b.v.cmplx_val.imag);
  1849. X            }
  1850. X    }
  1851. X    push(&result);
  1852. X}
  1853. X
  1854. X
  1855. Xf_minus()
  1856. X{
  1857. Xstruct value a, b, result;
  1858. X    (void) pop(&b);
  1859. X    (void) pop(&a);        /* now do a - b */
  1860. X    switch(a.type) {
  1861. X        case INT:
  1862. X            switch (b.type) {
  1863. X                case INT:
  1864. X                    (void) integer(&result,a.v.int_val -
  1865. X                        b.v.int_val);
  1866. X                    break;
  1867. X                case CMPLX:
  1868. X                    (void) complex(&result,a.v.int_val -
  1869. X                        b.v.cmplx_val.real,
  1870. X                       -b.v.cmplx_val.imag);
  1871. X            }
  1872. X            break;
  1873. X        case CMPLX:
  1874. X            switch (b.type) {
  1875. X                case INT:
  1876. X                    (void) complex(&result,a.v.cmplx_val.real -
  1877. X                        b.v.int_val,
  1878. X                        a.v.cmplx_val.imag);
  1879. X                    break;
  1880. X                case CMPLX:
  1881. X                    (void) complex(&result,a.v.cmplx_val.real-
  1882. X                        b.v.cmplx_val.real,
  1883. X                        a.v.cmplx_val.imag-
  1884. X                        b.v.cmplx_val.imag);
  1885. X            }
  1886. X    }
  1887. X    push(&result);
  1888. X}
  1889. X
  1890. X
  1891. Xf_mult()
  1892. X{
  1893. Xstruct value a, b, result;
  1894. X    (void) pop(&b);
  1895. X    (void) pop(&a);    /* now do a*b */
  1896. X
  1897. X    switch(a.type) {
  1898. X        case INT:
  1899. X            switch (b.type) {
  1900. X                case INT:
  1901. X                    (void) integer(&result,a.v.int_val *
  1902. X                        b.v.int_val);
  1903. X                    break;
  1904. X                case CMPLX:
  1905. X                    (void) complex(&result,a.v.int_val *
  1906. X                        b.v.cmplx_val.real,
  1907. X                        a.v.int_val *
  1908. X                        b.v.cmplx_val.imag);
  1909. X            }
  1910. X            break;
  1911. X        case CMPLX:
  1912. X            switch (b.type) {
  1913. X                case INT:
  1914. X                    (void) complex(&result,b.v.int_val *
  1915. X                        a.v.cmplx_val.real,
  1916. X                        b.v.int_val *
  1917. X                        a.v.cmplx_val.imag);
  1918. X                    break;
  1919. X                case CMPLX:
  1920. X                    (void) complex(&result,a.v.cmplx_val.real*
  1921. X                        b.v.cmplx_val.real-
  1922. X                        a.v.cmplx_val.imag*
  1923. X                        b.v.cmplx_val.imag,
  1924. X                        a.v.cmplx_val.real*
  1925. X                        b.v.cmplx_val.imag+
  1926. X                        a.v.cmplx_val.imag*
  1927. X                        b.v.cmplx_val.real);
  1928. X            }
  1929. X    }
  1930. X    push(&result);
  1931. X}
  1932. X
  1933. X
  1934. Xf_div()
  1935. X{
  1936. Xstruct value a, b, result;
  1937. Xregister double square;
  1938. X    (void) pop(&b);
  1939. X    (void) pop(&a);    /* now do a/b */
  1940. X
  1941. X    switch(a.type) {
  1942. X        case INT:
  1943. X            switch (b.type) {
  1944. X                case INT:
  1945. X                    if (b.v.int_val)
  1946. X                      (void) integer(&result,a.v.int_val /
  1947. X                        b.v.int_val);
  1948. X                    else {
  1949. X                      (void) integer(&result,0);
  1950. X                      undefined = TRUE;
  1951. X                    }
  1952. X                    break;
  1953. X                case CMPLX:
  1954. X                    square = b.v.cmplx_val.real*
  1955. X                        b.v.cmplx_val.real +
  1956. X                        b.v.cmplx_val.imag*
  1957. X                        b.v.cmplx_val.imag;
  1958. X                    if (square)
  1959. X                        (void) complex(&result,a.v.int_val*
  1960. X                        b.v.cmplx_val.real/square,
  1961. X                        -a.v.int_val*
  1962. X                        b.v.cmplx_val.imag/square);
  1963. X                    else {
  1964. X                        (void) complex(&result,0.0,0.0);
  1965. X                        undefined = TRUE;
  1966. X                    }
  1967. X            }
  1968. X            break;
  1969. X        case CMPLX:
  1970. X            switch (b.type) {
  1971. X                case INT:
  1972. X                    if (b.v.int_val)
  1973. X                      
  1974. X                      (void) complex(&result,a.v.cmplx_val.real/
  1975. X                        b.v.int_val,
  1976. X                        a.v.cmplx_val.imag/
  1977. X                        b.v.int_val);
  1978. X                    else {
  1979. X                        (void) complex(&result,0.0,0.0);
  1980. X                        undefined = TRUE;
  1981. X                    }
  1982. X                    break;
  1983. X                case CMPLX:
  1984. X                    square = b.v.cmplx_val.real*
  1985. X                        b.v.cmplx_val.real +
  1986. X                        b.v.cmplx_val.imag*
  1987. X                        b.v.cmplx_val.imag;
  1988. X                    if (square)
  1989. X                    (void) complex(&result,(a.v.cmplx_val.real*
  1990. X                        b.v.cmplx_val.real+
  1991. X                        a.v.cmplx_val.imag*
  1992. X                        b.v.cmplx_val.imag)/square,
  1993. X                        (a.v.cmplx_val.imag*
  1994. X                        b.v.cmplx_val.real-
  1995. X                        a.v.cmplx_val.real*
  1996. X                        b.v.cmplx_val.imag)/
  1997. X                            square);
  1998. X                    else {
  1999. X                        (void) complex(&result,0.0,0.0);
  2000. X                        undefined = TRUE;
  2001. X                    }
  2002. X            }
  2003. X    }
  2004. X    push(&result);
  2005. X}
  2006. X
  2007. X
  2008. Xf_mod()
  2009. X{
  2010. Xstruct value a, b;
  2011. X    (void) pop(&b);
  2012. X    (void) pop(&a);    /* now do a%b */
  2013. X
  2014. X    if (a.type != INT || b.type != INT)
  2015. X        int_error("can only mod ints",NO_CARET);
  2016. X    if (b.v.int_val)
  2017. X        push(integer(&a,a.v.int_val % b.v.int_val));
  2018. X    else {
  2019. X        push(integer(&a,0));
  2020. X        undefined = TRUE;
  2021. X    }
  2022. X}
  2023. X
  2024. X
  2025. Xf_power()
  2026. X{
  2027. Xstruct value a, b, result;
  2028. Xregister int i, t, count;
  2029. Xregister double mag, ang;
  2030. X    (void) pop(&b);
  2031. X    (void) pop(&a);    /* now find a**b */
  2032. X
  2033. X    switch(a.type) {
  2034. X        case INT:
  2035. X            switch (b.type) {
  2036. X                case INT:
  2037. X                    count = abs(b.v.int_val);
  2038. X                    t = 1;
  2039. X                    for(i = 0; i < count; i++)
  2040. X                        t *= a.v.int_val;
  2041. X                    if (b.v.int_val >= 0)
  2042. X                        (void) integer(&result,t);
  2043. X                    else
  2044. X                        (void) complex(&result,1.0/t,0.0);
  2045. X                    break;
  2046. X                case CMPLX:
  2047. X                    mag =
  2048. X                      pow(magnitude(&a),fabs(b.v.cmplx_val.real));
  2049. X                    if (b.v.cmplx_val.real < 0.0)
  2050. X                        mag = 1.0/mag;
  2051. X                    ang = angle(&a)*b.v.cmplx_val.real+
  2052. X                      b.v.cmplx_val.imag;
  2053. X                    (void) complex(&result,mag*cos(ang),
  2054. X                        mag*sin(ang));
  2055. X            }
  2056. X            break;
  2057. X        case CMPLX:
  2058. X            switch (b.type) {
  2059. X                case INT:
  2060. X                    if (a.v.cmplx_val.imag == 0.0) {
  2061. X                        mag = pow(a.v.cmplx_val.real,(double)abs(b.v.int_val));
  2062. X                        if (b.v.int_val < 0)
  2063. X                            mag = 1.0/mag;
  2064. X                        (void) complex(&result,mag,0.0);
  2065. X                    }
  2066. X                    else {
  2067. X                        /* not so good, but...! */
  2068. X                        mag = pow(magnitude(&a),(double)abs(b.v.int_val));
  2069. X                        if (b.v.int_val < 0)
  2070. X                            mag = 1.0/mag;
  2071. X                        ang = angle(&a)*b.v.int_val;
  2072. X                        (void) complex(&result,mag*cos(ang),
  2073. X                            mag*sin(ang));
  2074. X                    }
  2075. X                    break;
  2076. X                case CMPLX:
  2077. X                    mag = pow(magnitude(&a),fabs(b.v.cmplx_val.real));
  2078. X                    if (b.v.cmplx_val.real < 0.0)
  2079. X                      mag = 1.0/mag;
  2080. X                    ang = angle(&a)*b.v.cmplx_val.real+ b.v.cmplx_val.imag;
  2081. X                    (void) complex(&result,mag*cos(ang),
  2082. X                        mag*sin(ang));
  2083. X            }
  2084. X    }
  2085. X    push(&result);
  2086. X}
  2087. X
  2088. X
  2089. Xf_factorial()
  2090. X{
  2091. Xstruct value a;
  2092. Xregister int i;
  2093. Xregister double val;
  2094. X
  2095. X    (void) pop(&a);    /* find a! (factorial) */
  2096. X
  2097. X    switch (a.type) {
  2098. X        case INT:
  2099. X            val = 1.0;
  2100. X            for (i = a.v.int_val; i > 1; i--)  /*fpe's should catch overflows*/
  2101. X                val *= i;
  2102. X            break;
  2103. X        default:
  2104. X            int_error("factorial (!) argument must be an integer",
  2105. X            NO_CARET);
  2106. X        }
  2107. X
  2108. X    push(complex(&a,val,0.0));
  2109. X            
  2110. X}
  2111. X
  2112. X
  2113. Xint
  2114. Xf_jump(x)
  2115. Xunion argument *x;
  2116. X{
  2117. X    return(x->j_arg);
  2118. X}
  2119. X
  2120. X
  2121. Xint
  2122. Xf_jumpz(x)
  2123. Xunion argument *x;
  2124. X{
  2125. Xstruct value a;
  2126. X    int_check(&top_of_stack);
  2127. X    if (top_of_stack.v.int_val) {    /* non-zero */
  2128. X        (void) pop(&a);
  2129. X        return 1;                /* no jump */
  2130. X    }
  2131. X    else
  2132. X        return(x->j_arg);        /* leave the argument on TOS */
  2133. X}
  2134. X
  2135. X
  2136. Xint
  2137. Xf_jumpnz(x)
  2138. Xunion argument *x;
  2139. X{
  2140. Xstruct value a;
  2141. X    int_check(&top_of_stack);
  2142. X    if (top_of_stack.v.int_val)    /* non-zero */
  2143. X        return(x->j_arg);        /* leave the argument on TOS */
  2144. X    else {
  2145. X        (void) pop(&a);
  2146. X        return 1;                /* no jump */
  2147. X    }
  2148. X}
  2149. X
  2150. X
  2151. Xint
  2152. Xf_jtern(x)
  2153. Xunion argument *x;
  2154. X{
  2155. Xstruct value a;
  2156. X
  2157. X    int_check(pop(&a));
  2158. X    if (a.v.int_val)
  2159. X        return(1);                /* no jump; fall through to TRUE code */
  2160. X    else
  2161. X        return(x->j_arg);        /* go jump to FALSE code */
  2162. X}
  2163. END_OF_FILE
  2164. if test 13596 -ne `wc -c <'internal.c'`; then
  2165.     echo shar: \"'internal.c'\" unpacked with wrong size!
  2166. fi
  2167. # end of 'internal.c'
  2168. fi
  2169. if test -f 'iris4d.trm' -a "${1}" != "-c" ; then 
  2170.   echo shar: Will not clobber existing file \"'iris4d.trm'\"
  2171. else
  2172. echo shar: Extracting \"'iris4d.trm'\" \(2282 characters\)
  2173. sed "s/^X//" >'iris4d.trm' <<'END_OF_FILE'
  2174. X/*
  2175. XHere are the additions to GNUplot so it runs on an IRIS4D series computer.
  2176. XDon't forget to compile with -DIRIS4D and include -Zg as one of the
  2177. Xlibraries.  The window that the plot goes to can be reshaped and moved, but
  2178. Xyou will have to replot the data.
  2179. X
  2180. X+----------------------------------+-----------------------------+
  2181. X|John H. Merritt                   |  Yesterday I knew nothing,  |
  2182. X|Applied Research Corporation      |  Today I know that.         |
  2183. X|merritt@iris613.gsfc.nasa.gov     |                             |
  2184. X+----------------------------------+-----------------------------+
  2185. X*/
  2186. X
  2187. X/* Provided by John H. Merritt (Applied Research Corporation) 7/1/89 */
  2188. X/* INTERNET: merritt@iris613.gsfc.nasa.gov */
  2189. X
  2190. X#include <gl.h>
  2191. X#define IRIS4D_XMAX 1024
  2192. X#define IRIS4D_YMAX 1024
  2193. X
  2194. X#define IRIS4D_XLAST (IRIS4D_XMAX - 1)
  2195. X#define IRIS4D_YLAST (IRIS4D_YMAX - 1)
  2196. X
  2197. X#define IRIS4D_VCHAR (IRIS4D_YMAX/30)
  2198. X#define IRIS4D_HCHAR (IRIS4D_XMAX/72)
  2199. X#define IRIS4D_VTIC (IRIS4D_YMAX/80)
  2200. X#define IRIS4D_HTIC (IRIS4D_XMAX/80)
  2201. X
  2202. XIRIS4D_init()
  2203. X{
  2204. X  foreground();
  2205. X  winopen("Gnuplot");
  2206. X  deflinestyle(1, 0x3FFF); /* Long dash */
  2207. X  deflinestyle(2, 0x5555); /* dotted */
  2208. X  deflinestyle(3, 0x3333); /* short dash */
  2209. X  deflinestyle(4, 0xB5AD); /* dotdashed */
  2210. X  return;
  2211. X}
  2212. X
  2213. XIRIS4D_graphics()
  2214. X{
  2215. X  reshapeviewport();
  2216. X  ortho2((Coord)0, (Coord)IRIS4D_XMAX, (Coord)0, (Coord)IRIS4D_YMAX);
  2217. X  color(WHITE);
  2218. X  clear();
  2219. X  
  2220. X  return;
  2221. X}
  2222. X
  2223. XIRIS4D_text()
  2224. X{
  2225. X  return; /* enter text from another window!!! */
  2226. X}
  2227. X
  2228. XIRIS4D_linetype(linetype)
  2229. Xint linetype;
  2230. X{
  2231. X  static int pen_color[5] = {1, 2, 3, 4, 5};
  2232. X  
  2233. X  linetype = linetype % 5;
  2234. X  color((Colorindex) pen_color[linetype]);
  2235. X  setlinestyle(linetype);
  2236. X  return;
  2237. X}
  2238. X
  2239. XIRIS4D_move(x, y)
  2240. Xunsigned int x, y;
  2241. X{
  2242. X  move2i(x, y);
  2243. X  return;
  2244. X}
  2245. X
  2246. XIRIS4D_cmove(x, y)
  2247. Xunsigned int x, y;
  2248. X{
  2249. X  cmov2i(x, y);
  2250. X  return;
  2251. X}
  2252. X
  2253. XIRIS4D_vector(x, y)
  2254. Xunsigned x, y;
  2255. X{
  2256. X  draw2i(x, y);
  2257. X  return;
  2258. X}
  2259. X
  2260. XIRIS4D_lrput_text(row, str)
  2261. Xunsigned int row;
  2262. Xchar *str;
  2263. X{
  2264. X  IRIS4D_cmove(IRIS4D_XMAX - IRIS4D_HTIC - IRIS4D_HCHAR*(strlen(str)+1),
  2265. X          IRIS4D_VTIC + IRIS4D_VCHAR*(row+1)) ;
  2266. X  charstr(str);
  2267. X  return;
  2268. X}
  2269. X
  2270. X
  2271. XIRIS4D_ulput_text(row,str)
  2272. Xunsigned int row ;
  2273. Xchar *str ;
  2274. X{
  2275. X  IRIS4D_cmove(IRIS4D_HTIC, IRIS4D_YMAX - IRIS4D_VTIC - IRIS4D_VCHAR*(row+1)) ;
  2276. X  charstr(str);
  2277. X  return;
  2278. X}
  2279. X
  2280. XIRIS4D_reset()
  2281. X{
  2282. X  return;
  2283. X}
  2284. END_OF_FILE
  2285. if test 2282 -ne `wc -c <'iris4d.trm'`; then
  2286.     echo shar: \"'iris4d.trm'\" unpacked with wrong size!
  2287. fi
  2288. # end of 'iris4d.trm'
  2289. fi
  2290. if test -f 'lineproc.mac' -a "${1}" != "-c" ; then 
  2291.   echo shar: Will not clobber existing file \"'lineproc.mac'\"
  2292. else
  2293. echo shar: Extracting \"'lineproc.mac'\" \(1979 characters\)
  2294. sed "s/^X//" >'lineproc.mac' <<'END_OF_FILE'
  2295. X; lineproc.mac
  2296. X; MASM macro definition for Bresenham line-drawing routine
  2297. X; Colin Kelley
  2298. X; January 13, 1987
  2299. X
  2300. X
  2301. XINCAX    equ 40h            ; for Self-Modifying Code
  2302. XINCBX    equ 43h
  2303. XDECAX    equ 48h
  2304. XDECBX    equ 4bh
  2305. X
  2306. X; usage:
  2307. X;   lineproc linename, pixelname
  2308. X;
  2309. X; where linemane is the name you want for the proc, and pixelname is the
  2310. X;   name of the routine that linename is to call to set pixels
  2311. X;
  2312. X
  2313. Xlineproc macro linename, pixelname
  2314. Xbeginproc linename
  2315. X
  2316. X    push bp
  2317. X    mov bp,sp
  2318. X    push si
  2319. X    push di
  2320. X    mov ax,[bp+X]        ; x1
  2321. X    mov bx,[bp+X+2]        ; y1
  2322. X    mov cx,[bp+X+4]        ; x2
  2323. X    mov si,[bp+X+6]        ; y2
  2324. X
  2325. X    cmp ax,cx        ; x1,x2
  2326. X    jne i19
  2327. X    cmp bx,si        ; y1,y2
  2328. X    jne i19
  2329. X
  2330. X    call pixelname
  2331. X
  2332. X    jmp i28
  2333. Xi19:
  2334. X    mov dx,ax        ; dx,x1
  2335. X    sub dx,cx        ; x2
  2336. X    jnc noabsx
  2337. X    neg dx
  2338. Xnoabsx:
  2339. X    mov di,bx        ; dy,y1
  2340. X    sub di,si        ; y2
  2341. X    jnc noabsy
  2342. X    neg di            ; dy
  2343. Xnoabsy:
  2344. X    cmp dx,di        ; dx,dy
  2345. X    jb i21            ; go iterate y's
  2346. X;
  2347. X; iterate x's
  2348. X;
  2349. X    cmp bx,si        ; y1,y2
  2350. X    jb forwardy
  2351. X    mov byte ptr cs:yinc1,DECBX
  2352. X    jmp short i22
  2353. Xforwardy:
  2354. X    mov byte ptr cs:yinc1,INCBX
  2355. Xi22:
  2356. X    cmp ax,cx        ; x1,x2
  2357. X    jae l20004
  2358. X    mov byte ptr cs:xinc1,INCAX
  2359. X    jmp short l20005
  2360. Xl20004:
  2361. X    mov byte ptr cs:xinc1,DECAX
  2362. Xl20005:
  2363. X    mov bp,dx        ; sum,dx
  2364. X    shr bp,1        ; sum
  2365. Xd23:
  2366. X    cmp ax,cx        ; x1,x2
  2367. X    je i28            ; done
  2368. Xxinc1:    inc ax            ; may become inc or dec
  2369. X    add bp,di        ; sum,dy
  2370. X    cmp bp,dx
  2371. X    jb i27
  2372. X    sub bp,dx        ; sum,dx
  2373. Xyinc1:    inc bx            ; may become inc or dec
  2374. Xi27:
  2375. X    call pixelname
  2376. X    jmp short d23
  2377. X
  2378. X;
  2379. X; else iterate y's
  2380. X;
  2381. Xi21:
  2382. X    cmp ax,cx        ; x1,x2
  2383. X    jae l20006
  2384. X    mov byte ptr cs:xinc2,INCAX
  2385. X    jmp short l20007
  2386. Xl20006:
  2387. X    mov byte ptr cs:xinc2,DECAX
  2388. Xl20007:
  2389. X    cmp bx,si        ; y1,y2
  2390. X    jb forwardy2
  2391. X    mov byte ptr cs:yinc2,DECBX
  2392. X    jmp short i29
  2393. Xforwardy2:
  2394. X    mov byte ptr cs:yinc2,INCBX
  2395. Xi29:
  2396. X    mov bp,di        ; sum,dy
  2397. X    shr bp,1        ; sum,1
  2398. Xd30:
  2399. X    cmp bx,si        ; y1,y2
  2400. X    je i28
  2401. Xyinc2:    inc bx            ; may become inc or dec
  2402. X    add bp,dx        ; sum,dx
  2403. X    cmp bp,di        ; sum,dy
  2404. X    jb i34
  2405. X    sub bp,di        ; sum,dy
  2406. Xxinc2:    inc ax            ; may become inc or dec
  2407. Xi34:
  2408. X    call near ptr pixelname
  2409. X    jmp short d30
  2410. X;
  2411. X; clean up and exit
  2412. X;
  2413. Xi28:    pop di
  2414. X    pop si
  2415. X    pop bp
  2416. X    ret
  2417. X
  2418. Xlinename endp
  2419. X    endm
  2420. END_OF_FILE
  2421. if test 1979 -ne `wc -c <'lineproc.mac'`; then
  2422.     echo shar: \"'lineproc.mac'\" unpacked with wrong size!
  2423. fi
  2424. # end of 'lineproc.mac'
  2425. fi
  2426. if test -f 'link.com' -a "${1}" != "-c" ; then 
  2427.   echo shar: Will not clobber existing file \"'link.com'\"
  2428. else
  2429. echo shar: Extracting \"'link.com'\" \(151 characters\)
  2430. sed "s/^X//" >'link.com' <<'END_OF_FILE'
  2431. X$ link/exe=gnuplot command,eval,graphics,internal,misc,parse,plot,scanner, -
  2432. Xstandard,[]term,util,version,sys$input:/opt
  2433. Xsys$share:vaxcrtl.exe/share
  2434. X$
  2435. END_OF_FILE
  2436. if test 151 -ne `wc -c <'link.com'`; then
  2437.     echo shar: \"'link.com'\" unpacked with wrong size!
  2438. fi
  2439. # end of 'link.com'
  2440. fi
  2441. if test -f 'link.opt' -a "${1}" != "-c" ; then 
  2442.   echo shar: Will not clobber existing file \"'link.opt'\"
  2443. else
  2444. echo shar: Extracting \"'link.opt'\" \(125 characters\)
  2445. sed "s/^X//" >'link.opt' <<'END_OF_FILE'
  2446. Xcommand+eval+graphics+internal+misc+parse+plot+scanner+standard+term+util+version+pcgraph+corgraph+hrcgraph,gnuplot,nul,ega;
  2447. END_OF_FILE
  2448. if test 125 -ne `wc -c <'link.opt'`; then
  2449.     echo shar: \"'link.opt'\" unpacked with wrong size!
  2450. fi
  2451. # end of 'link.opt'
  2452. fi
  2453. if test -f 'link.otc' -a "${1}" != "-c" ; then 
  2454.   echo shar: Will not clobber existing file \"'link.otc'\"
  2455. else
  2456. echo shar: Extracting \"'link.otc'\" \(175 characters\)
  2457. sed "s/^X//" >'link.otc' <<'END_OF_FILE'
  2458. X\tc\lib\C0l command eval graphics internal misc parse plot scanner standard term util version ,gnuplot,gnuplot, \tc\lib\emu \tc\lib\mathl \tc\lib\cl \tc\lib\graphics
  2459. X        
  2460. END_OF_FILE
  2461. if test 175 -ne `wc -c <'link.otc'`; then
  2462.     echo shar: \"'link.otc'\" unpacked with wrong size!
  2463. fi
  2464. # end of 'link.otc'
  2465. fi
  2466. echo shar: End of archive 2 \(of 7\).
  2467. cp /dev/null ark2isdone
  2468. MISSING=""
  2469. for I in 1 2 3 4 5 6 7 ; do
  2470.     if test ! -f ark${I}isdone ; then
  2471.     MISSING="${MISSING} ${I}"
  2472.     fi
  2473. done
  2474. if test "${MISSING}" = "" ; then
  2475.     echo You have unpacked all 7 archives.
  2476.     rm -f ark[1-9]isdone
  2477. else
  2478.     echo You still need to unpack the following archives:
  2479.     echo "        " ${MISSING}
  2480. fi
  2481. ##  End of shell archive.
  2482. exit 0
  2483.